#include <iostream>
#include <vector>
#include <random>

long num = 0;
long sum = 0;
long num2 = 0;
std::vector<bool> isPrime(1, true);

int main(){
int flag1, flag2, flag3, flag4, flag5;
flag1 = 100;


	while(true){
		if (flag1 == 100){
			std::cout<<"Input a number:";
			std::cin>>num;
			std::vector<bool> isPrime(num/100+1, true);
			flag1 = 0;
			flag4 = 1;
			std::cout<<1111<<std::endl;
			
		}
///////////////////////////////
		if (flag2 == 1){
		        isPrime[0] = false;
        		isPrime[1] = false;
        		for (int i = 2; i <= sqrt(num2); i++) {
                		if (isPrime[i]) {
                			for (int j = i*i; j <= num2; j += i) {
                        		isPrime[j] = false;
                			}
        			}	

			}
			flag2=0;
			flag3=1;
			std::cout<<3333<<std::endl;
		}

//////////////////////////////

		if (flag3 == 1){
			sum = 0;
    			for (int i = 2; i <= num2; i++) {
        			 std::cout<<isPrime[i]<<std::endl;	
				if (isPrime[i]) {sum += i;}
    
			}
			flag3 = 0;
			flag5 = 8;
		}

///////////////////////////////


		if(flag4 == 1){
			
			num2 = num/100;
			flag2 = 1;
			flag4 = 0;
			std::cout<<2222<<std::endl;
		}
///////////////////////////////

	if(flag5==8) break;
	}

std::cout<<sum<<std::endl;
}
